# python3
import _thread
import threading

# _thread
# threading
# python2
# thread
# 使用_thread模块创建线程 ------基本语法
# _thread.start_new_thread(函数, 函数入参)

# import _thread
# import time
#
#
# # 为线程定义一个函数
# def print_name(thread_name):
#     count = 0
#     while count < 5:
#         time.sleep(1)
#         count += 1
#         print(thread_name)
#
#
# _thread.start_new_thread(print_name, ("Thread-1",))
# _thread.start_new_thread(print_name, ("Thread-2",))
#
# while 1:
#     pass


# thrrading
# import threading
#
#
# class MyThread(threading.Thread):
#     def run(self):
#         print("hello world")
#
#
# thread = MyThread()
# thread.start()


import threading


def my_fun():
    print("Hello world")


threading.Thread(target=my_fun).start()
